<?php
	query_posts('numberposts=6&orderby=rand');     
	$count = 0; 
?>
<div class="container nogradient">
  <div class="container_inside">
    <div class="content_full">
      <h2>Random Posts</h2>
      <?php if (have_posts()) : ?>
      <ul class="gallery">
      	<?php while (have_posts()) : the_post(); ?>
        <?php
			$ibizmag_postimg_100px = get_post_meta($post->ID, "ibizmag_postimg_100px", true);
			
			if($count == 6)
				break;
		?>
      	<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $ibizmag_postimg_100px; ?>" alt="<?php the_title(); ?>" /></a></li>
        <?php $count++; ?>
    	<?php endwhile; ?>
      </ul>
      <div class="refresh"> <a href="<?php echo get_settings('home'); ?>" title="Refresh Random Posts">Refresh Random Posts</a> </div>
      <?php else: ?>
        No post available to display
      <?php endif; ?>
    </div>
  </div>
</div>
